<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="context-path" th:content="@{/}" />
    <title>zkWebClient</title>

    <!-- Bootstrap -->
    <link th:href="@{/bootstrap-3.3.7/css/bootstrap.min.css}" rel="stylesheet" />
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script th:src="@{/jquery.min.js}"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script th:src="@{/bootstrap-3.3.7/js/bootstrap.min.js}"></script>
    <!-- <script th:src="@{/bootstrap-3.3.7/bootstrap-select/bootstrap-select.js}"></script> -->

	<link rel="stylesheet" type="text/css" th:href="@{/ztree/css/metroStyle/metroStyle.css}" />
	<script th:src="@{/ztree/jquery.ztree.all.min.js}"></script>
	<script th:src="@{/js/zkWebClient.js}"></script>	
</head>
<body>
	<div class="container">
		<div class="panel panel-default">
			<div class="panel-heading">Conf</div>
			<div class="panel-body">
		        <form id="conf_form">
		          <div class="form-group">
		            <label for="connectString" class="control-label">connectString:</label>
		            <input type="text" class="form-control" id="connectString"  placeholder="localhost:2181"></input>
		          </div>
		          <div class="form-group">
		            <label for="sessionTimeout" class="control-label">sessionTimeout(ms):</label>
		            <input type="text" class="form-control" id="sessionTimeout" placeholder="30000"></input>
		          </div>
		          <button id="confSubmitBtn" type="button" class="btn btn-default">Submit</button>
		        </form>				
			</div>
		</div>
		<div class="panel panel-default">
			<div class="panel-heading">Data</div>
			<div class="panel-body">
				<ul id="treeDemo" class="ztree"></ul>
			</div>
		</div>
	</div>


	<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
	  <div class="modal-dialog" role="document">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title" id="addModalLabel">添加节点</h4>
	      </div>
	      <div class="modal-body">
	        <form id="add_form">
	          <div class="form-group">
	            <label for="add_parent_path" class="control-label">父节点:</label>
	            <input type="text" class="form-control" id="add_parent_path" readonly="readonly"></input>
	          </div>
	          <div class="form-group">
	            <label for="add_path" class="control-label">节点名:</label>
	            <input type="text" class="form-control" id="add_path"></input>
	          </div>
	          <div class="form-group">
	            <label for="add_type" class="control-label">类型:</label>
				<select id="add_type" class="selectpicker show-tick form-control" data-live-search="false">
                   <option value="0">PERSISTENT</option>
                   <option value="1">EPHEMERAL</option>
                   <option value="2">PERSISTENT_SEQUENTIAL</option>
                   <option value="3">EPHEMERAL_SEQUENTIAL</option>
                </select>	            
	          </div>
	          <div class="form-group">
	            <label for="add_data" class="control-label">节点值:</label>
	            <textarea class="form-control" id="add_data"></textarea>
	          </div>
	        </form>
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
	        <button id="add_submit" type="button" class="btn btn-primary" onclick="addNode();">提交</button>
	      </div>
	    </div>
	  </div>
	</div>
	
	<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel">
	  <div class="modal-dialog" role="document">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title" id="editModalLabel">修改节点</h4>
	      </div>
	      <div class="modal-body">
	        <form id="edit_form">
	          <div class="form-group">
	            <label for="edit_path" class="control-label">节点名:</label>
	            <input type="text" class="form-control" id="edit_path" readonly="readonly"></input>
	          </div>
	          <div class="form-group">
	            <label for="edit_data" class="control-label">节点值:</label>
	            <textarea class="form-control" id="edit_data"></textarea>
	          </div>
	        </form>
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
	        <button id="edit_submit" type="button" class="btn btn-primary" onclick="editNode();">提交</button>
	      </div>
	    </div>
	  </div>
	</div>
	
</body>
</html>